#!/bin/bash

#cp $DEVICE/GoogleMaps.apk  $OUT/system/app
#echo "-------cp GoogleMaps.apk to out dir OK!!--------"
rm $OUT/system/app/Update.apk
rm $OUT/system/app/SpeechRecorder.apk
rm $OUT/system/app/Development.apk


if [ "$1" = "help" ]
then
	echo "pack A7008_AIMEI  "
	echo "pack A7008_SANYI  "
	echo "pack A7008_XST  "	
	echo "pack Q8  "
	echo "pack Q11"
	echo "pack cj7102-3"				
	return 0
elif [ "$1" = "-c" ]
then
	bash $DEVICE/ChipHDConfig/chiphd_cfg.sh
elif [ "$1" = "A7008_AIMEI" ]
then
	echo "--------A7008_AIMEI-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh A7008_AIMEI	

#-----------------A6502_AIMEI-------------------	
elif [ "$1" = "A6502_AIMEI" ]
then
	echo "--------A6502_AIMEI-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh A6502_AIMEI


elif [ "$1" = "A7008_SANYI" ]
then
	echo "--------A7008_SANYI-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh A7008_SANYI	
elif [ "$1" = "A7008_HONGXIANG" ]
then
	echo "--------A7008_HONGXIANG-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh A7008_HONGXIANG		
elif [ "$1" = "A7008_XST" ]
then
	echo "--------A7008_XST-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh A7008_XST		
elif [ "$1" = "cj7102-3" ]
then
	echo "--------cj7102-3-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh cj7102-3	
elif [ "$1" = "Q11" ]
then
	echo "--------Q11-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q11	 	 
elif [ "$1" = "Q8" ]
then
	echo "--------Q8-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q8	 	
elif [ "$1" = "N713" ]
then
	echo "--------N713-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh N713		 	
elif [ "$1" = "M11" ]
then
	echo "--------M11-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh M11			
elif [ "$1" = "Q11-V17" ]
then
	echo "--------Q11-V17-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q11-V17				
elif [ "$1" = "Q11-V17S" ]
then
	echo "--------Q11-V17S-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q11-V17S					
elif [ "$1" = "cj8101" ]
then
	echo "--------cj8101-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh cj8101		

elif [ "$1" = "Q8-WCB" ]
then
	echo "--------Q8-WCB-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q8-WCB		

elif [ "$1" = "Q8-1024" ]
then
	echo "--------Q8-1024-------------"
	bash $DEVICE/ChipHDConfig/chiphd_cfg_super.sh Q8-1024							
fi


make systemimage-nodeps
cd $PACKAGE
if [ "$1" = "-d" ]; then
	echo "--------debug version, have uart printf-------------"
  ./pack -c sun7i -p android -b wing-q8  -d card0
else
	echo "--------release version, donnot have uart printf-------------"
	./pack -c sun7i -p android -b wing-q8  -d uart0
fi
cd -
